<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

<h1>html5大文件断点切割上传</h1>
<div id="progressBar"></div>

<input id="file" name="mov" type="file"/>
<input id="btn" type="button" value="点我上传"/>
<input id="btn1" type="button" value="点我停止上传"/>

<script type="module">
    import FileSliceUpload from '../jsutils/FileSliceUpload.js'

    let testingUrl = "http://localhost:7003/fileslice/testing"
    let uploadUrl = "http://localhost:7003/fileslice/uploads"
    let margeUrl = "http://localhost:7003/fileslice/merge-file-slice"
    let progressUrl = "http://localhost:7003/fileslice/progress"
    let fileSliceUpload = new FileSliceUpload(testingUrl, uploadUrl, margeUrl, progressUrl, "#file")
    fileSliceUpload.addProgress("#progressBar")
    let btn = document.querySelector("#btn")
    let btn1 = document.querySelector("#btn1")
    btn.addEventListener("click", function () {
        fileSliceUpload.startUploadFile()
    })
    btn1.addEventListener("click", function () {
        fileSliceUpload.stopUploadFile()
    })

</script>


</body>

</html>
